/**
 * @Author: 田乐
 * @Date: 2019/08/27
 * @Last Modified by: mikey.zhaopeng
 * @Last Modified time: 2019/08/27
 */
const RouteView = () => import('@/layout/RouteView');
// 异步路由组件加载
const AsyncComponent = __name__ => () => import(`@/pages/${__name__}`);

// 菜单路由
const menuRoutes = [
  {
    path: '/origin',
    meta: { title: '渠道管理', icon: 'el-icon-s-promotion' },
    redirect: '/origin',
    component: RouteView,
    children: [
      {
        path: '/origin/construct',
        meta: { title: '渠道建设管理' },
        redirect: '/origin/construct',
        component: RouteView,
        children: [
          {
            path: '/origin/construct/dealer/index',
            meta: { title: '经销商入网维护', keepAlive: true },
            component: AsyncComponent('cms-pages/origin/construct/dealer/index')
          },
          {
            path: '/origin/construct/review/index',
            meta: { title: '建设验收审核', keepAlive: true },
            component: AsyncComponent('cms-pages/origin/construct/review/index')
          },
          {
            path: '/origin/construct/inquire/index',
            meta: { title: '建设验收查询', keepAlive: true },
            component: AsyncComponent('cms-pages/origin/construct/inquire/index')
          },
          {
            path: '/origin/construct/process/index',
            meta: { title: '建设过程维护', keepAlive: true },
            component: AsyncComponent('cms-pages/origin/construct/process/index')
          }
        ]
      },
      {
        path: '/origin/originInfo',
        meta: { title: '渠道信息管理' },
        redirect: '/origin/originInfo',
        component: RouteView,
        children: [
          {
            path: '/origin/originInfo/maintain/index',
            meta: { title: '经销商信息维护', keepAlive: true },
            component: AsyncComponent('cms-pages/origin/originInfo/maintain/index')
          },
          {
            path: '/origin/originInfo/review/index',
            meta: { title: '经销商信息审核', keepAlive: true },
            component: AsyncComponent('cms-pages/origin/originInfo/review/index')
          },
          {
            path: '/origin/originInfo/bankCheck/index',
            meta: { title: '经销商信息财务审核', keepAlive: true },
            component: AsyncComponent('cms-pages/origin/originInfo/bankCheck/index')
          },
          {
            path: '/origin/originInfo/inquire/index',
            meta: { title: '经销商信息查询', keepAlive: true },
            component: AsyncComponent('cms-pages/origin/originInfo/inquire/index')
          },
          {
            path: '/origin/originInfo/serviceDealerBase/index',
            meta: { title: '服务中心基础信息维护', keepAlive: true },
            component: AsyncComponent('cms-pages/origin/originInfo/serviceDealerBase/index')
          },
          {
            path: '/origin/originInfo/company/index',
            meta: { title: '公司信息维护', keepAlive: true },
            component: AsyncComponent('cms-pages/origin/originInfo/company/index')
          },
          {
            path: '/origin/originInfo/sapDetail',
            meta: { title: '新能源SAP信息维护', keepAlive: true },
            component: AsyncComponent('origin/originInfo/sapDetail')
          }
        ]
      },
      {
        path: '/origin/personnelInfo',
        meta: { title: '人员信息管理' },
        redirect: '/origin/personnelInfo',
        component: RouteView,
        children: [
          {
            path: '/origin/personnelInfo/postSet/index',
            meta: { title: '岗位设置', keepAlive: true },
            component: AsyncComponent('cms-pages/origin/personnelInfo/postSet/index')
          },
          {
            path: '/origin/personnelInfo/personnelInfoMaintain/index',
            meta: { title: '人员信息维护', keepAlive: true },
            component: AsyncComponent('cms-pages/origin/personnelInfo/personnelInfoMaintain/index')
          },
          {
            path: '/origin/personnelInfo/personnelInfoInquire/index',
            meta: { title: '人员信息查询', keepAlive: true },
            component: AsyncComponent('cms-pages/origin/personnelInfo/personnelInfoInquire/index')
          }
        ]
      },
      {
        path: '/origin/baseSetting',
        meta: { title: '基础参数定义' },
        redirect: '/origin/baseSetting',
        component: RouteView,
        children: [
          {
            path: '/origin/baseSetting/construction/index',
            meta: { title: '渠道建设项目维护', keepAlive: true },
            component: AsyncComponent('cms-pages/origin/baseSetting/construction/index')
          },
          {
            path: '/origin/baseSetting/constructionChilren/index',
            meta: { title: '渠道建设子项目维护', keepAlive: true },
            component: AsyncComponent('cms-pages/origin/baseSetting/constructionChilren/index')
          },
          {
            path: '/origin/personnelInfo/areaMaintain/index',
            meta: { title: '经销商区域经理维护', keepAlive: true },
            component: AsyncComponent('cms-pages/origin/personnelInfo/areaMaintain/index')
          }
        ]
      }
    ]
  }
];

export default menuRoutes;
